package com.IntelligentCommunity.community.api.factory;

import com.IntelligentCommunity.community.api.RemoteFacilitiesService;
import com.IntelligentCommunity.community.api.RemoteVehiclestService;
import com.IntelligentCommunity.community.domain.DeployVehicles;
import lombok.extern.log4j.Log4j2;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author 美国五星上将麦克阿瑟
 */
@Component
@Log4j2
public class RemoteVehiclesFallbackFactory implements FallbackFactory<RemoteVehiclestService> {

    @Override
    public RemoteVehiclestService create(Throwable cause) {
        return new RemoteVehiclestService() {
            @Override
            public void vehiclesAdd(DeployVehicles deployVehicles) {
                log.error("远程调用失败", cause);
            }
        };
    }
}
